<%@ page language="java" import="java.util.*,cat.commons.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE HTML">
<html>
  <head>
    <title></title>

	<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-1.8.0.js"></script> 
	<script type="text/javascript">
		$(function(){
			$("#ch_checkall,#top_ch_checkall").click(function(){
				if(this.checked){
					$("input[name=ck_id]").attr("checked","checked");
				}else{
					$("input[name=ck_id]").removeAttr("checked");
				}		
			});
			
			
			$("table tr").mouseover(function(){
				$(this).css("background","#D3EAEF");
				$(this).siblings().css("background","white");
			});
		});
	</script>

	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/maintable.css" ></link>


  </head>
  
  <body>

				<div class ="div_title">
						<div class="div_titlename"> <img src="images/san_jiao.gif" ><span>系统中的角色列表</span></div>
						<div class="div_titleoper">
							<input type="checkbox" id="top_ch_checkall"/> 全选 <a href="${pageContext.request.contextPath }/admin/admin_add.jsp"> <img src="images/add.gif"/>添加 </a> <a href="javascript:void(0)"><img src="images/del.gif"/>删除</a> </div>
				 </div>
				 
				 <form action="${pageContext.request.contextPath }/RoleServlet.do"  name="form1">
				
				 <table class="main_table" >
				       <tr>
				 				<th><input type="checkbox" id="ch_checkall" /></th>	<th>角色名称</th> 	<th>角色描述</th> <th>操作</th>
				 		</tr>
				 		<c:forEach var="role" items="${roleList}">
				 		<tr>
				 				<td>
				 					<input type="checkbox" name="ck_id" value="${role.id}" /> 
				 				</td>
				 				<td>${role.roleName }</td>	
				 			
				 				<td> ${role.roleName }</td>	
				 				
				 			
				 				<td>
					 			
					 		    <a href="javascript:void(0)">修改</a> | 
					 			
					 			
					 			<a href="${pageContext.request.contextPath }/RoleServlet.do?flag=delete&roleId=${role.id}" onclick="return confirm('确定要删除该角色吗')" >删除</a> |  
					 				
					
					 			   <a href="${pageContext.request.contextPath }/perm/rolemenu_edit.jsp?roleId=${role.id }">角色权限分配</a> 

				 				</td>
				 		</tr>
				   		 </c:forEach>
				 	
				</table>
				</form>
				
			
				
	  <script type="text/javascript">
	  	 var msg='${msg}';
	  	 if(msg!=''){
	  	 	alert(msg);
	  	 }
	  </script>
  </body>
</html>
